home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / gnu / emacs_src_18_58.lha / emacs-18.58 / lisp / dbx.elc < prev    next >
Text File  |  1992-02-21  |  4KB  |  73 lines

  1.  
  2. (require (quote shell))
  3.  
  4. (defvar dbx-trace-flag nil "\
  5. Dbx trace switch.")
  6.  
  7. (defvar dbx-process nil "\
  8. The process in which dbx is running.")
  9.  
  10. (defvar dbx-break-point "stopped in .* at line \\([0-9]*\\) in file \"\\([^\"]*\\)\"" "\
  11. Regexp of pattern that dbx writes at break point.")
  12.  
  13. (defvar inferior-dbx-mode-map nil)
  14.  
  15. (if inferior-dbx-mode-map nil (setq inferior-dbx-mode-map (copy-keymap shell-mode-map)) (define-key inferior-dbx-mode-map "w" (quote dbx-where)) (define-key inferior-dbx-mode-map "" (quote dbx-trace-mode)) (define-key ctl-x-map " " (quote dbx-stop-at)))
  16.  
  17. (defun inferior-dbx-mode nil "\
  18. Major mode for interacting with an inferior Dbx process.
  19.  
  20. The following commands are available:
  21. \\{inferior-dbx-mode-map}
  22.  
  23. Entry to this mode calls the value of dbx-mode-hook with no arguments,
  24. if that value is non-nil.  Likewise with the value of shell-mode-hook.
  25. dbx-mode-hook is called after shell-mode-hook.
  26.  
  27. You can display the debugging program in other window and point out
  28. where you are looking at using the command \\[dbx-where].
  29.  
  30. \\[dbx-trace-mode] toggles dbx-trace mode. In dbx-trace mode,
  31. debugging program is automatically traced using output from dbx.
  32.  
  33. The command \\[dbx-stop-at] sets break point at current line of the
  34. program in the buffer. Major mode name of the buffer must be in
  35. dbx-language-mode-list.
  36.  
  37. Commands:
  38.  
  39. Return at end of buffer sends line as input.
  40. Return not at end copies rest of line to end and sends it.
  41. \\[shell-send-eof] sends end-of-file as input.
  42. \\[kill-shell-input] and \\[backward-kill-word] are kill commands, imitating normal Unix input editing.
  43. \\[interrupt-shell-subjob] interrupts the shell or its current subjob if any.
  44. \\[stop-shell-subjob] stops, likewise. \\[quit-shell-subjob] sends quit signal, likewise.
  45. \\[dbx-where] displays debugging program in other window and
  46.  points out where you are looking at.
  47. \\[dbx-trace-mode] toggles dbx-trace mode.
  48. \\[dbx-stop-at] sets break point at current line." (interactive) (byte-code "LjʠˆË‰ˆÌ‰ˆÍ‰ˆÎ !ˆÏÄ!ˆÐ ‰ˆÏÅ!ˆÐ ‰ˆÏÆ!ˆÇ‰ˆÑÈ!ˆÒ‰ˆÓÆ    \"†HÔ    B‰    ˆÕÖ×\"‡" [major-mode mode-name mode-line-process inferior-dbx-mode-map last-input-start last-input-end dbx-trace-flag nil shell-prompt-pattern minor-mode-alist kill-all-local-variables inferior-dbx-mode "Inferior Dbx" (": %s") use-local-map make-local-variable make-marker make-variable-buffer-local "^[^)]*dbx) *" assq (dbx-trace-flag " Trace") run-hooks shell-mode-hook dbx-mode-hook] 12))
  49.  
  50. (defun run-dbx (path) "\
  51. Run an inferior Dbx process, input and output via buffer *dbx*." (interactive "fProgram to debug: ") (byte-code "ÈŠ   !ÆÇÈQ!ˆÉ    !‰ˆÆÊËPÌÃ$!)ˆÍp!‰ˆÎ Ï\"ˆÐ ‡" [file path default-directory nil dbx-process file-name-nondirectory switch-to-buffer "*dbx-" "*" file-name-directory make-shell "dbx-" "dbx" get-buffer-process set-process-filter dbx-filter inferior-dbx-mode] 9))
  52.  
  53. (defun dbx-trace-mode (arg) "\
  54. Toggle dbx-trace mode.
  55. With arg, turn dbx-trace mode on iff arg is positive.
  56. In dbx-trace mode, user program is automatically traced." (interactive "P") (byte-code "ÈÄ=?… ÅÆ!ˆ
  57. ?ƒ    ?‚Ç
  58. !ÈV‰ˆÉÊ !‡" [major-mode dbx-trace-flag arg nil inferior-dbx-mode error "Dbx-trace mode is effective in inferior-dbx mode only." prefix-numeric-value 0 set-buffer-modified-p buffer-modified-p] 5))
  59.  
  60. (defun dbx-filter (process string) "\
  61. Trace debugging program automatically if dbx-trace-flag is not nil." (byte-code "ŠÅ!qˆdbˆ`
  62. cˆ …Æ    Ä\")ˆÇ!…$ÈÇ!d\")ˆÅ!p=…0db‡" [process beg string dbx-trace-flag t process-buffer dbx-where process-mark set-marker] 8))
  63.  
  64. (defun dbx-where (&optional begin quiet) "\
  65. Display dbx'ed program in other window and point out where you are looking at.
  66. BEGIN bounds the search. If QUIET, just return nil (no error) if fail." (interactive) (byte-code "ňÅÅŠÈ
  67. #…$ÉÊË!ÌË!\"‰ˆÉÊÍ!ÌÍ!\"‰)ˆ…+    …XÎÏÅ\"!ˆÐÑ    !!ˆÒ ˆÓ‰ˆ†MÔ ‰ˆÕ`p#ˆÖË!*‡" [file line dbx-break-point begin quiet nil overlay-arrow-string overlay-arrow-position re-search-backward buffer-substring match-beginning 1 match-end 2 find-file-other-window expand-file-name goto-line string-to-int beginning-of-line "=>" make-marker set-marker other-window] 17))
  68.  
  69. (defun dbx-stop-at nil "\
  70. Set break point at current line." (interactive) (byte-code "ĈŠ   !ŒÆ ˆÇÈ`\"T)É ÊËÌ
  71. Í%\"*‡" [file-name buffer-file-name line dbx-process nil file-name-nondirectory widen count-lines 1 send-string concat "stop at \"" "\":" "
  72. "] 11))
  73.